﻿using System;
using System.IO;
using System.Web;

using Lucene.Net.Store;
using Directory = Lucene.Net.Store.Directory;

using mvcForum.SearchProvider.Lucene.Indexes;

namespace mvcForum.SearchProvider.Lucene {

	public class FileSystemDirectoryResolver : IDirectoryResolver {
		private readonly String root;

		public FileSystemDirectoryResolver(String root) {
			this.root = root;
		}

		public Directory GetDirectory() {
			// TODO:
			return FSDirectory.Open(new DirectoryInfo(Path.Combine(root, "Indexes")));
		}
	}
}